//
//  MRMModel.m
//  MeiRiMoney
//
//  Created by qiuqk on 13-6-24.
//  Copyright (c) 2013年 MeiRiCai. All rights reserved.
//

#import "MRMModel.h"
#import "MR_Convert.h"

@implementation LoginResult

- (id)initWithDictionary:(NSDictionary *) dict
{
	if (dict == nil) {
		return nil;
	}
	
	self.DeviceId = [MR_Convert getStringWithKey:@"DeviceId" fromDictionary:dict];
    self.IntegralBalance = [MR_Convert getLongWithKey:@"IntegralBalance" fromDictionary:dict];
	self.Token = [MR_Convert getStringWithKey:@"Token" fromDictionary:dict];
	self.Secret = [MR_Convert getStringWithKey:@"Secret" fromDictionary:dict];
    return self;
}

@end

@implementation TaskItem

/**
 * 利用字典初始化
 */
- (id)initWithDictionary:(NSDictionary *) dict
{
	if (dict == nil) {
		return nil;
	}
	
	self.Key = [MR_Convert getStringWithKey:@"Key" fromDictionary:dict];
    self.Name = [MR_Convert getStringWithKey:@"Name" fromDictionary:dict];
	self.Serial = [MR_Convert getIntWithKey:@"Serial" fromDictionary:dict];
	self.Category = [MR_Convert getIntWithKey:@"Category" fromDictionary:dict];
    return self;
}

/**
 * 利用参数初始化
 */
- (id)initWithKey:(NSString *)key Name:(NSString *)name Serial:(int)serial Category:(int)category
{
	self.Key = key;
    self.Name = name;
	self.Serial = serial;
	self.Category = category;
    return self;
}

@end

/**
 * 全局设置
 */
@implementation GSetting : NSObject

/**
 * 利用字典初始化
 */
- (id)initWithDictionary:(NSDictionary *) dict;
{
	if (dict == nil) {
		return nil;
	}
	
	self.Key = [MR_Convert getStringWithKey:@"Key" fromDictionary:dict];
    self.Value = [MR_Convert getStringWithKey:@"Value" fromDictionary:dict];
	self.Description = [MR_Convert getStringWithKey:@"Description" fromDictionary:dict];
    return self;
}

@end